<template>
  <!-- 头部搜索组件 -->
  <div class="searchBox">
    <div class="serTlt">查询表格</div>
    <el-form ref="form" label-position="left" label-width="auto" @submit.native.prevent>
      <div class="serFlexBox">
        <div class="inputBox">
          <el-row class="inputBox" :gutter="24" type="flex">
            <el-col :span="8">
              <el-form-item :label="title">
                <el-input v-model="sKeywords" v-clearEmoij clearable style="width: 70%;" @keyup.enter.native="searchFn"
                  placeholder="请输入..." />
              </el-form-item>
              <!-- <span style="margin-right: 10px; font-size: 14px;color:rgba(0, 0, 0, 0.9);">{{ title }}</span> -->
            </el-col>
          </el-row>
        </div>
        <div class="btnBox">
          <el-button @click.stop="searchFn" class="searchBtn" icon="el-icon-search">搜索</el-button>
          <el-button @click.stop="emptyFn" class="resetBtn" icon="el-icon-refresh-right">重置</el-button>
        </div>
      </div>
    </el-form>
    <!-- <el-row class="btnBox" :gutter="24" type="flex" justify="end">
      <el-col :span="8"> -->
    <!-- <el-button  class="searchBtn" @click="searchFn">搜索</el-button>
        <el-button style="width: 80px;" @click="emptyFn">重置</el-button> -->

    <!-- </el-col>
    </el-row> -->
  </div>
</template>

<script>
export default {
  name: 'GoodsSearch',
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      sKeywords: ''
    }
  },
  methods: {
    searchFn() {
      console.log('搜索')
      this.$emit('searchFn', this.sKeywords)
    },
    emptyFn() {
      this.sKeywords = ''
      console.log('清空')
      this.$emit('emptyFn')
    }
  }
}
</script>

<style scoped lang="scss">
// .goods_search {
//   // margin-bottom: 15px;
//   // height: 150px;
//   // background-color: #fff;
//   // padding: 30px 20px 20px 80px;

//   // .inputBox {
//   //   margin-bottom: 30px;
//   // }
// }
</style>
